 
 
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="common/head::head"></head>
<body>

<div th:include="common/header::header"></div>

<div th:include="common/column::column"></div>

<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8 content detail">
        <!--详细信息-->
        <div class="fly-panel detail-box" th:if="${vo.posts.delFlag == '1'}">
            <div class="fly-none">哎呀呀，该贴已被主人删除</div>
        </div>
      <div class="fly-panel detail-box"  th:if="${vo.posts.delFlag != '1'}">
        <h1 th:text="${vo.posts.title}"></h1>
        <div class="fly-detail-info">
          <!-- <span class="layui-badge">审核中</span> -->
          <!-- <span class="layui-badge" style="background-color: #5FB878;">已结</span> -->
          
          <span class="layui-badge layui-bg-black" th:if="${vo.posts.top}">置顶</span>
          <span class="layui-badge layui-bg-red" th:if="${vo.posts.essence}">精帖</span>
          
          <div class="fly-admin-box" th:data-id="${vo.posts.id}">
            <span class="layui-btn layui-btn-xs jie-admin" type="del" th:if="${editable}">删除</span>
            
            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="1" th:if="${user?.roleId=='sys_admin' && !vo.posts.top}">置顶</span>
            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="top" rank="0" style="background-color:#ccc;" th:if="${user?.roleId=='sys_admin' && vo.posts.top}">取消置顶</span>

            <!--<span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="1">加精</span> -->
            <!-- <span class="layui-btn layui-btn-xs jie-admin" type="set" field="status" rank="0" style="background-color:#ccc;">取消加精</span> -->
          </div>
          <span class="fly-list-nums layui-hide-xs">
            <a href="#comment"><i class="jie-admin iconfont" title="评论">&#xe60c;</i> <span th:text="${vo.posts.readCount}"></span> </a>
            <!--<i class="iconfont" title="人气">&#xe60b;</i> 99-->
          </span>
        </div>
        <div class="detail-about">
            <a th:href="@{'/user/home?id=' + ${vo.user.id}}" class="fly-avatar">
                <img th:src="@{${vo.user.portrait}}" th:alt="${vo.user.username}">
            </a>
          <div class="fly-detail-user">
              <a th:href="@{'/user/home?id=' + ${vo.user.id}}" class="fly-link">
                  <cite th:text="${vo.user.username}"></cite>
                  <i class="iconfont icon-renzheng" th:title="${'认证信息：' + vo.role.name}"></i>
              </a>
              <span th:text="${#dates.format(vo.posts.publishTime, 'yyyy-MM-dd hh:mm:ss')}"></span>
          </div>
          <div class="detail-hits" id="LAY_jieAdmin" th:data-id="${vo.posts.id}">
            <span style="padding-right: 10px; color: #FF7200" th:text="${#strings.append('评分：', (vo.posts.score>0?vo.posts.score:'无'))}"></span>
            <span class="layui-btn layui-btn-xs jie-admin" type="edit" th:if="${editable}"><a th:href="@{'/posts/edit?id='+${vo.posts.id}}">编辑此贴</a></span>
            <span th:if="${collect != null}" th:class="${collect?'layui-btn layui-btn-xs jie-admin layui-btn-danger':'layui-btn layui-btn-xs jie-admin'}" type="collect" th:data-type="${collect?'remove':'add'}"><span th:if="${!collect}">收藏</span><span th:if="${collect}">取消收藏</span></span>
          </div>
        </div>

        <div class="detail-body photos" th:text="${vo.posts.content}">

        </div>
      </div>

        <!--老师点评-->
      <div class="fly-panel detail-box" th:if="${log != null}">
        <div class="layui-card">
          <div class="layui-card-header">老师点评</div>
          <div class="layui-card-body">
            <span th:text="${log?.content}" style="color: #FF7200;"></span>
          </div>
        </div>
      </div>

        <!--点赞信息-->
        <div class="fly-panel detail-box">
            <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
                <legend>喜欢点个赞</legend>
            </fieldset>
            <div class="jieda-reply">
                <ul>
                    <li th:data-id="${vo.posts.id}" style="display: block; width: 100%; text-align: center;">
                      <span th:class="${zan?'jieda-zan zanok':'jieda-zan'}" type="zan">
                        <i class="iconfont icon-zan"></i>
                        <em th:text="${vo.posts.experience}"></em>
                      </span>
                    </li>
                    <li id="zanUsers">
                        <div style="display: inline" th:if="${likeLogs!=null}" th:each="likeLog:${likeLogs}">@<a href="javascript:;" class="fly-aite" style="color: #4f99cf" th:text="${likeLog?.username}"></a></div>
                    </li>
                </ul>
            </div>
        </div>

        <!--回复信息-->
      <div class="fly-panel detail-box" id="flyReply">
        <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
          <legend>回帖</legend>
        </fieldset>

        <ul class="jieda" id="jieda">
          <li th:each="rep:${reps}" th:data-id="${rep.postsReply.id}">
            <a th:name="'item-'+${rep.postsReply.id}"></a>
            <div class="detail-about detail-about-reply">
              <a class="fly-avatar" href="">
                <img th:src="@{${rep.user.portrait}}" th:alt="${rep.user.username}">
              </a>
              <div class="fly-detail-user">
                <a href="" class="fly-link">
                  <cite th:text="${rep.user.username}"></cite>
                  <i class="iconfont icon-renzheng" th:title="${'认证信息：' + rep.role.name}"></i>
                </a>
                
                <span th:if="${#strings.equals(rep.user.id, vo.user.id)}">(楼主)</span>
              </div>

              <div class="detail-hits">
                <span th:text="${#dates.format(rep.postsReply.createTime, 'yyyy-MM-dd')}"></span>
              </div>

            </div>
            <div class="detail-body jieda-body photos" th:text="${rep.postsReply.content}">
            </div>
            <div class="jieda-reply">
              <span type="reply">
                <i class="iconfont icon-svgmoban53"></i>
                回复
              </span>
              <div class="jieda-admin">
                <!--<span type="edit">编辑</span>-->
                <!--<span type="del">删除</span>-->
                <!-- <span class="jieda-accept" type="accept">采纳</span> -->
              </div>
            </div>
          </li>
          
           <li class="fly-none" th:if="${reps == null}">消灭零回复</li>
        </ul>

        <div style="text-align: center">
          <div id="pageTool"></div>
        </div>
        
        <div class="layui-form layui-form-pane">
          <form th:action="@{/jie/reply}" method="post">
            <div class="layui-form-item layui-form-text">
              <a name="comment"></a>
              <div class="layui-input-block">
                <textarea id="L_content" name="content" required lay-verify="required" placeholder="请输入内容"  class="layui-textarea fly-editor" style="height: 150px;"></textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <input type="hidden" name="jid" th:value="${vo.posts.id}">
              <button class="layui-btn" lay-filter="*" lay-submit>提交回复</button>
            </div>
          </form>
        </div>
      </div>

    </div>

    <div class="layui-col-md4">

      <div th:include="common/replyrank::replyrank"></div>

      <div th:include="common/ad::ad"></div>


    </div>
  </div>
</div>

<div th:include="common/footer::footer"></div>

<script th:src="@{/layui/layui.js}"></script>
<script th:inline="javascript">
  layui.cache.page = 'jie';
  layui.cache.user = {
      username: [[${user==null?'游客':user.username}]]
      ,id: [[${user==null?-1:user.id}]]
  };
  layui.config({
    version: "3.0.0"
    ,base: '/mods/'
  }).extend({
    fly: 'index'
  }).use(['fly', 'face'], function(){
    var $ = layui.$
    ,fly = layui.fly;
    //如果你是采用模版自带的编辑器，你需要开启以下语句来解析。
    $('.detail-body').each(function(){
      var othis = $(this), html = othis.html();
      othis.html(fly.content(html));
    });
  });
  layui.use('laypage', function(){
      var postId = [[${vo.posts.id}]];
      var laypage = layui.laypage;
      //执行一个laypage实例
      laypage.render({
          elem: 'pageTool'
          ,count: [[${repCount}]]
          ,curr: [[${repPageNo}]]
          ,limit: [[${repPageSize}]]
          ,first: '首页'
          ,last: '尾页'
          ,prev: '<em>上一页</em>'
          ,next: '<em>下一页</em>'
          ,jump: function (obj, first) {
              //得到了当前页，用于向服务端请求对应数据
              if (!first) {
                  location.href = '/jie/detail?id='+postId+'&repPageNo=' + obj.curr;
              }
          }
      });
  });
</script>

</body>
</html>